﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace EBA.Reporting.Spreadsheet
{
    /// <summary>
    /// 工作簿
    /// </summary>
    public class Workbook
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public Workbook()
        {
            this.Worksheets = new WorksheetCollection();
        }

        /// <summary>
        /// 工作表集合
        /// </summary>
        public WorksheetCollection Worksheets { get; private set; }

        /// <summary>
        /// 新增工作表
        /// </summary>
        /// <param name="worksheet"></param>
        public void AddWorksheet(Worksheet worksheet)
        {
            this.Worksheets.Add(worksheet);
        }

        /// <summary>
        /// 根据索引删除工作表
        /// </summary>
        /// <param name="index"></param>
        public void RemoveWorksheetAt(int index)
        {
            this.Worksheets.RemoveAt(index);
        }

        /// <summary>
        /// 根据名称删除工作表
        /// </summary>
        /// <param name="name"></param>
        public void RemoveWorksheetNamed(string name)
        {
            this.Worksheets.RemoveNamed(name);
        }
    }
}
